<template>
<div>
    <home-header></home-header>
    <home-swiper></home-swiper>
    <home-icons></home-icons>
    <home-recomment></home-recomment>
    <home-week-play></home-week-play>
    <test-axios :list="testAxiosList"></test-axios>
</div>
</template>

<script>
import HomeHeader from './Components/Header'
import HomeSwiper from './Components/Swiper'
import HomeIcons from './Components/Icons'
import HomeRecomment from './Components/ReCommend'
import HomeWeekPlay from './Components/WeekPlay'
import TestAxios from './Components/TestAxios'
import axios from 'axios'
export default {
  name: 'Home',
  components: {
    HomeHeader,
    HomeSwiper,
    HomeIcons,
    HomeRecomment,
    HomeWeekPlay,
    TestAxios
  },
  data () {
    return {
      testAxiosList: []
    }
  },
  methods: {
    gethomeInfo () {
      axios.get('api/news/latest')
        .then(this.getHomeInfoSucc)
    },
    getHomeInfoSucc (res) {
      if (res.data) {
        const data = res.data
        this.testAxiosList = data.stories
        console.log(1)
        console.log(data)
      }
    }
  },
  mounted () {
    this.gethomeInfo()
  },
  activated () {
    this.gethomeInfo()
  }
}
</script>

<style>
</style>
